ΕΠΙΣΤΡΟΦΗ
Υλοποίηση μέσω γλώσσας Wolfram στο WLJS Notebook .
Μερικές Διαφορικές Εξισώσεις
Εξίσωση κύματος ($\partial_{tt} u-c^2 \nabla^2 u=0$)
Clear["Global`*"]
PDE = D[u[x, t], {t, 2}] - c^2 D[u[x, t], {x, 2}] == 0
(*arb1, arb2 αυθαίρετες*)
uSol[x_, t_] := arb1[x + c t] + arb2[x - c t]
Clear["Global`*"]
PDE = D[u[x, t], {t, 2}] - c^2 D[u[x, t], {x, 2}] == 0;
u[x, t] = X[x]*T[t]
PDE = D[u[x, t], {t, 2}] - c^2 D[u[x, t], {x, 2}] == 0
init1 = u[x, 0] == f[x]
init2 = Derivative[0, 1][u][x, 0] == g[x]
bound1 = u[0, t] == 0
bound2 = u[L, t] == 0
PDE[[1]]/(c^2 X[x] T[t]) // Apart
ODEt = T''[t]/(c^2 T[t]) == λ
ODEx = X''[x]/X[x] == λ
Assuming[λ > 0, DSolve[ODEx, X[x], x]]
Assuming[λ > 0, DSolve[{ODEx, X[0] == 0, X[L] == 0}, X[x], x]]
ODEx = X''[x] == 0
DSolve[{ODEx}, X[x], x]
DSolve[{ODEx, X[0] == 0, X[L] == 0}, X[x], x]
λ = -k^2
ODEx = X''[x] + k^2 X[x] == 0
DSolve[{ODEx}, X[x], x]
DSolve[{ODEx, X[0] == 0, X[L] == 0}, X[x], x]
k = (m Pi)/L
DSolve[{ODEx, X[0] == 0, X[L] == 0}, X[x], x]
DSolve[ODEt, T[t], t]
a[m_] := Assuming[Element[m, Integers],
Integrate[f[x] Sin[(m π x)/L], {x, 0, L}]/
Integrate[(Sin[(m π x)/L])^2, {x, 0, L}]]
a[m]
b[m_] := Assuming[Element[m, Integers],
Integrate[g[x] Sin[(m π x)/L], {x, 0, L}]/((c m Pi)/
L Integrate[(Sin[(m π x)/L])^2, {x, 0, L}])]
b[m]
un[x_, t_, m_] :=
Sin[(m π x)/L] (a[m] Cos[(c m π t)/L] + b[m] Sin[(c m π t)/L])
uApprox[x_, t_, n0_] := Sum[un[x, t, m], {m, 1, n0}]
uApprox[x, t, 4]
c = 4;
L = 2 Pi;
f[x_] := x^2
g[x_] := 2 x - 1
uApprox[x, t, 6]
Table[Plot3D[Evaluate[uApprox[x, t, n0]], {x, 0, L}, {t, 0, 10}], {n0, 1, 6}]
Plot3D[Evaluate[uApprox[x, t, 30]], {x, 0, L}, {t, 0, 10}, AxesLabel -> {"x","t"}]
Static web notebook
Author kkoud
Created Thu 11 Sep 2025 08:38:17
Outline
Κώστας Κούδας | © 2025